package com.pussinboots.morning.sync.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Builder;
import lombok.Data;
import lombok.experimental.Accessors;
import lombok.experimental.Tolerate;

import java.io.Serializable;

/**
 * <p>
 * 商品-区域关联表
 * </p>
 *
 * @author BaoZhou
 * @since 2019-09-11
 */
@Data
//支持链式风格
@Accessors(chain = true)
@Builder
@TableName("os_product_area")
public class ProductArea extends Model<ProductArea> {

    private static final long serialVersionUID = 1L;

    /**
     * 解决@Data与@Builder一起使用，实体类没有无参构造函数的坑
     * 此注解让lombok假装不知道有此方法，这样就不会与@Data产生冲突
     */
    @Tolerate
    public ProductArea(){}

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private Integer productId;

    private Integer areaCode;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}